import request from '@/utils/request'
/*
  获取banner接口数据
*/
export function getBanner(position_key) {
  return request({
    url: `/banner?position_key=${position_key}`,
    method: 'get'
  })
}

export function getDiaryData(page = 1, per_page = 8) {
  return request({
    url: '/diary-group/recomm',
    method: 'get',
    params: {
      page, per_page
    }
  })
}

export function getSearchDiary(search_key, page = 1, per_page = 8) {
  return request({
    url: '/search/diary-group',
    method: 'get',
    params: {
      search_key,
      page,
      per_page
    }
  })
}

export function getDoctorData(sort_key, sort_val, page = 1, per_page = 5) {
  return request({
    url: `/doctor/list`,
    method: 'get',
    params: {
      sort_key,
      sort_val,
      page,
      per_page
    }
  })
}

export function gethospital(sort_key, sort_val, page, per_page) {
  return request({
    url: '/hospital/list',
    method: 'get',
    params: {
      sort_key,
      sort_val,
      page,
      per_page
    }
  })
}

export function getBannerHover(class_id) {
  return request({
    url: '/classify/project',
    method: 'get',
    params: {
      class_id
    }
  })
}
